<%--
  User: Administrator
  Date: 2020/10/17
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js"></script>
    <title>保存试卷页</title>
    <script>
        function checkForm() {
            var name = $("#name").val();
            if (name == null || name == "") {
                $("#error").html("试卷名称不能为空！");
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
<div class="data_list">
    <div class="data_info">
        <p>${title }</p>
    </div>
    <div class="data_content">
        <form action="paperAction!save" method="post" onsubmit="return checkForm()">
            <input type="hidden" id="createTime" name="paper.createTime" value="${paper.createTime }"/>
            <input type="hidden" id="id" name="id" value="${paper.id }"/>
            <table width="40%" align="center">
                <tr>
                    <td><label>试卷名称：</label></td>
                    <td><input type="text" id="name" name="paper.name" value="${paper.name }"/></td>
                </tr>
                <tr>
                    <td>
                        <button class="btn btn-primary" type="submit">保存</button>
                    </td>
                    <td>
                        <button class="btn btn-primary" type="button" onclick="javascript:history.back()">返回</button>
                        &nbsp;&nbsp;<span id="error" style="color: red">${error }</span>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
</body>
</html>
